import request from '@/config'

// 查询题目
export const apiGetExamApi = (params) => {
    return request.get({
        url: '/answer/ielts/topics',
        params
    })
}

// 提交单个题目
export const apiSubmitTopic = (data) => {
    return request.post({
        url: '/answer/ielts/submit/topic',
        data
    })
}

// 提交练习
export const apiSubmitExam = (data) => {
    return request.post({
        url: '/answer/ielts/submit/practice',
        data
    })
}

// 获取答题记录的基本信息和最后一次答题记录
export const apiRecordHead = (params) => {
    return request.get({
        url: '/record/ielts/head',
        params
    })
}

// 获取历史答题记录
export const apiRecordList = (params) => {
    return request.get({
        url: '/record/ielts/list',
        params
    })
}

// 获取答题记录详情页面
export const apiRecordInfo = (id) => {
    return request.get({
        url: '/record/ielts/info/' + id
    })
}

// 重新开始作答
export const apiReDoExam = (data) => {
    return request.post({
        url: '/answer/ielts/answering',
        data
    })
}

// 获取听力晒选列表
export const apiGetListenClass = (type) => {
    return request.get({
        url: `/ielts/subject/listen/search/items/${type}`
    })
}

// 获取听力练习试卷列表
export const apiGetListenTestList = (params) => {
    return request.get({
        url: '/ielts/subject/listen/list',
        params
    })
}

// 获取阅读晒选列表
export const apiGetReadClass = (type) => {
    return request.get({
        url: `/ielts/subject/read/search/items/${type}`
    })
}

// 获取听阅读练习试卷列表
export const apiGetReadTestList = (params) => {
    return request.get({
        url: '/ielts/subject/read/list',
        params
    })
}

// 提交作答时间
export const apiSubmitDuration = (data) => {
    return request.post({
        url: '/answer/ielts/submit/topic/duration',
        data
    })
}

export const login = (data) => {
    return request.post({
        url: '/answer/ielts/topics',
        data
    })
}
// 获取听力顶部
export const apiGetSearchItems = (type) => {
    return request.get({
        url: `/ielts/subject/listen/search/items/${type}`
    })
}

// 获取学员状态 是否绑定学员号，学员号是否过期
export const apiGetSpecialStudentStatus = () => {
    return request.get({ url: '/answer/ielts/specialStudentStatus' })
}

// 获取题目解析
export const apiGetTopicAnalysis = (params) => {
    return request.get({
        url: '/ieltsReadingInputTopic/getTopicAnalysis',
        params
    })
}
// 获取听力解析
export const apiGetListenTopicAnalysis = (params) => {
    return request.get({
        url: '/ieltsListeningInputTopic/getTopicAnalysis',
        params
    })
}
